package org.example.netty.zdyxieyi;

import lombok.Data;


@Data
public class LoginMessage implements Message{

    private int messageType = 1;
    private int sequenceId = 1;
    private String userName;
    private int age;

    public LoginMessage(String userName, int age) {
        this.userName = userName;
        this.age = age;
    }

    public LoginMessage(String userName, int age, int messageType) {
        this.userName = userName;
        this.age = age;
        this.messageType = messageType;
    }

    @Override
    public int getMessageType() {
        return this.messageType;
    }

    @Override
    public String toString() {
        return "LoginMessage{" +
                "userName='" + userName + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public int getSequenceId() {
        return this.sequenceId;
    }
}
